<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>提现明细</title>
<!--bootstrap.min.css-->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <!--font-awesome.css?v=4.4.0-->
    <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!--bootstrap.min.css-->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <!--custom.css-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/plugins/iCheck/custom.css"/>
	<!--style.css-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css"/>
	<!--jquery.min.js-->
	<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div class="">
    <ol class="breadcrumb">
        <li>电子银行</li>
        <li class="active">提现申请</li>
    </ol>
    <div class="panel panel-success">
        <!-- <div class="panel-heading">
            <h3 class="panel-title">消费账户列表</h3>
        </div> -->
        <br />
         <form action="${pageContext.request.contextPath}/KitingServlet/selectByName" method="post">
           <!--  <div class="panel-body">
            <span style="font-size: 16px">
             	这里是消费账户列表。。。
            </span>
               	 
                <button href=" " class="btn btn-primary pull-right">搜索</button>
            </div> -->
            <div class="col-sm-3" style="float: right;">
            	<div class="input-group">
            		<input type="text" name="user_name" placeholder="请输入会员姓名" class="input-sm form-control" value="${user_name}">
            			<span class="input-group-btn">
            				<button class="btn btn-sm btn-primary" > 搜索</button> 
            			</span>
            	</div>
            </div>
            <table class="table table-bordered table-hover" style="table-layout: fixed" >
                <tr>
                    <th><input type="checkbox" name="i-checks" id="all"></th>
                    <th>交易单号</th>
                    <th>会员姓名</th>
                    <th>银行名称</th>
                    <th>银行卡号</th>
                    <th>提现金额</th>
                    <th>余额</th>
                    <th>删除记录</th>
                </tr>
                <c:forEach items="${kitingList}" var="kitingList">
                    <tr>
                        <td><input type="checkbox" name="trade_id" class="che" value="${kitingList.trade_id}"></td>
                        <td>${kitingList.trade_id}</td>
                        <td>${kitingList.user_name}</td>
                        <td>${kitingList.bank_name}</td>
                        <td>${kitingList.user_cardNo}</td>
                        <td>${kitingList.money}</td>
                        <td>${kitingList.user_money}</td>
                        <td><div class="btn btn-sm btn-link delete" onclick="removeById(this)"  trade_id="${kitingList.trade_id}"><span class="glyphicon glyphicon-trash"></span></div></td>
                    </tr>
                </c:forEach>
            </table>
            <div class="btn btn-danger" onclick="removeSelect()">删除选中</div>
             <div class="pag" style="margin-left:350px"> </div>
        </form>
    </div>
</div>
</body>
<!--jquery.min.js-->
<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<!--bootstrap.min.js-->
<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!--jquery.peity.min.js-->
<script src="<%=basePath%>js/plugins/peity/jquery.peity.min.js" type="text/javascript" charset="utf-8"></script>
<!--content.js-->
<script src="<%=basePath%>js/content.js" type="text/javascript" charset="utf-8"></script>
<!--icheck.min.js-->
<script src="<%=basePath%>js/plugins/iCheck/icheck.min.js" type="text/javascript" charset="utf-8"></script>
<!--peity-demo.js-->
<script src="<%=basePath%>js/demo/peity-demo.js" type="text/javascript" charset="utf-8"></script>
<!--layer.min.js-->
<script src="<%=basePath%>js/plugins/layer/layer.min.js" type="text/javascript" charset="utf-8"></script>
<!-- 分页的js -->
<script src="<%=basePath%>js/plugins/jquery-bootstrap-pagination/jquery-bootstrap-pagination.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>js/plugins/toastr/toastr.min.js" type="text/javascript" charset="utf-8"></script>
<script>

/* 分页 */
$(".pag").pagination({
	total_pages:${pageCount},
    current_page:${pageNum},
    prev:"上一页",
    next:"下一页",
    display_max: 4,
    callback:function (event,page) {
    	$('form').append("<input type='hidden' name='pageNum' value='"+page+"'>");
    	$('form').submit();
       
    }
});

$("#all").click(function() {
	$(":checkbox").prop('checked',$(this).prop('checked'));
});

function removeById(obj) {
    //ajax：
    $.get('${pageContext.request.contextPath}/KitingServlet/removeById',{"trade_id":$(obj).attr('trade_id')},function (s) {
        if(s==1){
            $(obj).parent().parent().remove();
            layer.msg('删除成功',function(){
            	time:1000
            });
        }else{
            alert('失败');
        }
    });
};

function removeSelect() {
    $.get('${pageContext.request.contextPath}/KitingServlet/removeSelect',$('.che').serialize(),function (s) {
        if(s==1){
        	layer.msg('删除成功',{icon: 1},function(){
            	time:400,
            	location.reload();
            });
        }else{
            layer.alert('请选中后再删除',{icon: 5});
        }
    });
};



$(document).ready(function () {
    $(".i-checks").iCheck(
    	{checkboxClass: "icheckbox_square-green", 
    	radioClass: "iradio_square-green",})
});





</script>


</html>